package com.springcloud.sc.ucpv5.client.commondata.data;

import java.util.Arrays;

import com.springcloud.sc.ucpv5.client.commondata.datachange.DataExChange;

public class GbDeviceListQueryList extends DataExChange{
    public com.springcloud.sc.ucpv5.client.commondata.data.Device[] devices; //子设备列表
    
    /**
     * 从probuf对象获取当前对象
     * 
     * @param builder_src
     * @return
     */
    public void dataChangeProBufDataToCommon(com.google.protobuf.Message builder_src) {
	try {
	    com.proto.uuos_sdk_pb.GbDeviceListQueryList builder_dst = (com.proto.uuos_sdk_pb.GbDeviceListQueryList) builder_src;

	    devices = new com.springcloud.sc.ucpv5.client.commondata.data.Device[builder_dst.getDevicesCount()];
	    
	    System.out.println(builder_dst.getDevicesCount());
	    for (int i = 0; i < builder_dst.getDevicesCount(); i++) {
		devices[i] = new com.springcloud.sc.ucpv5.client.commondata.data.Device();
		devices[i].dataChangeProBufDataToCommon(builder_dst.getDevices(i));
	    }
	} catch (Exception e) {
	    e.printStackTrace();
	}
    }


    public String toString() {
	return "GbDeviceListQueryList [devices=" + Arrays.toString(devices) + "]";
    }
    
    
}
